﻿/**
 ** @作者:	   王桂龙 QQ731513122
 ** @日期:	   2019.12.6
 ** @简介:     ContextMenuStrip      
 */
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;

namespace BHXJDOTNET.OLD
{
    public partial class BHXJContextMenuStrip : ContextMenuStrip
    {
        [Description("菜单字体颜色"), Category("BHXJ")]
        /// <summary>
        /// 菜单字体颜色
        /// </summary>
        public Color FontColor
        {
            get { return this.bhxjrenderer.FontColor; }
            set { this.bhxjrenderer.FontColor = value; this.Invalidate(); }
        }

        [Description("下拉菜单坐标图标区域开始颜色"), Category("BHXJ")]
        /// <summary>
        /// 下拉菜单坐标图标区域开始颜色
        /// </summary>
        public Color MarginStartColor
        {
            get { return this.bhxjrenderer.MarginStartColor; }
            set { this.bhxjrenderer.MarginStartColor = value; this.Invalidate(); }
        }

        [Description("下拉菜单坐标图标区域结束颜色"), Category("BHXJ")]
        /// <summary>
        /// 下拉菜单坐标图标区域结束颜色
        /// </summary>
        public Color MarginStopColor
        {
            get { return this.bhxjrenderer.MarginStopColor; }
            set { this.bhxjrenderer.MarginStopColor = value; this.Invalidate(); }
        }

        [Description("下拉项背景颜色"), Category("BHXJ")]
        /// <summary>
        /// 下拉项背景颜色
        /// </summary>
        public Color DropDownItemBackColor
        {
            get { return this.bhxjrenderer.DropDownItemBackColor; }
            set { this.bhxjrenderer.DropDownItemBackColor = value; this.Invalidate(); }
        }

        [Description("下拉项选中时开始颜色"), Category("BHXJ")]
        /// <summary>
        /// 下拉项选中时开始颜色
        /// </summary>
        public Color DropDownItemStartColor
        {
            get { return this.bhxjrenderer.DropDownItemStartColor; }
            set { this.bhxjrenderer.DropDownItemStartColor = value; this.Invalidate(); }
        }

        [Description("下拉项选中时结束颜色"), Category("BHXJ")]
        /// <summary>
        /// 下拉项选中时结束颜色
        /// </summary>
        public Color DropDownItemStopColor
        {
            get { return this.bhxjrenderer.DropDownItemStopColor; }
            set { this.bhxjrenderer.DropDownItemStopColor = value; this.Invalidate(); }
        }

        [Description("主菜单项选中时的开始颜色"), Category("BHXJ")]
        /// <summary>
        /// 主菜单项选中时的开始颜色
        /// </summary>
        public Color MenuItemStartColor
        {
            get { return this.bhxjrenderer.MenuItemStartColor; }
            set { this.bhxjrenderer.MenuItemStartColor = value; this.Invalidate(); }
        }

        [Description("主菜单项选中时的结束颜色"), Category("BHXJ")]
        /// <summary>
        /// 主菜单项选中时的结束颜色
        /// </summary>
        public Color MenuItemStopColor
        {
            get { return this.bhxjrenderer.MenuItemStopColor; }
            set { this.bhxjrenderer.MenuItemStopColor = value; this.Invalidate(); }
        }

        [Description("分割线颜色"), Category("BHXJ")]
        /// <summary>
        /// 分割线颜色
        /// </summary>
        public Color SeparatorColor
        {
            get { return this.bhxjrenderer.SeparatorColor; }
            set { this.bhxjrenderer.SeparatorColor = value; this.Invalidate(); }
        }

        [Description("主菜单背景开始颜色"), Category("BHXJ")]
        /// <summary>
        /// 主菜单背景开始颜色
        /// </summary>
        public Color MainMenuStartColor
        {
            get { return this.bhxjrenderer.MainMenuStartColor; }
            set { this.bhxjrenderer.MainMenuStartColor = value; this.Invalidate(); }
        }

        [Description("主菜单背景结束颜色"), Category("BHXJ")]
        /// <summary>
        /// 主菜单背景结束颜色
        /// </summary>
        public Color MainMenuStopColor
        {
            get { return this.bhxjrenderer.MainMenuStopColor; }
            set { this.bhxjrenderer.MainMenuStopColor = value; this.Invalidate(); }
        }

        [Description("下拉区域边框颜色"), Category("BHXJ")]
        /// <summary>
        /// 下拉区域边框颜色
        /// </summary>
        public Color DropDownBorder
        {
            get { return this.bhxjrenderer.DropDownBorder; }
            set { this.bhxjrenderer.DropDownBorder = value; this.Invalidate(); }
        }



       

        /// <summary>
        /// 自定义Renderer
        /// </summary>
        private BHXJToolStripRenderer bhxjrenderer = new BHXJToolStripRenderer();


        public BHXJContextMenuStrip()
        {
            //使用自定义Renderer
            this.Renderer = bhxjrenderer;
        }

        public BHXJContextMenuStrip(IContainer container)
        {
            container.Add(this);
            //使用自定义Renderer
            this.Renderer = bhxjrenderer;
        }
    }
}
